#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
	vector<int> rearrangeArray(vector<int>& nums)
	{
		vector<int> pos, neg, res;
		for (int num: nums)
			if (num > 0) pos.emplace_back(num);
			else neg.emplace_back(num);
		for(int i=0,len=size(nums);i<len;i++){
			if (i & 1) res.emplace_back(neg[i >> 1]);
			else res.emplace_back(pos[i >> 1]);
		}
		return res;
	}

private:
};

int main()
{
	[[maybe_unused]] Solution solution;
	return 0;
}
